<template>
  <div v-if="isLoading" class="spinner">
    <div class="circle"></div>
  </div>
</template>

<script setup>
import { ref } from 'vue'

// Define a prop or a reactive variable to control the loading state
const isLoading = ref(true) // This should be passed or controlled from the parent component
</script>

<style scoped>
.spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 60vh;
  width: 100%;
}

.circle {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-left-color: rgba(22, 177, 58, 1);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}
</style>
